<template>
    <div class="answer-item" @click="goDetail(item)">
        <div class="title">
            {{ item.title }}
        </div>
        <div class="line"></div>
    </div>
</template>

<script>
export default {
    name: "pqtItem",
    props: {
        item: {
            type: Object,
            default: () => {
                return {};
            },
        },
    },
    data() {
        return {};
    },
    methods: {
        goDetail(item) {
            if (item.status == 3) {
                let { href } = this.$router.resolve({
                    path: "/cswd/"+item.id+'.html',
                });
             
                window.open(href, "_blank");
            } else {
               
                this.$emit('goDetail', item)
            }
        },
    },
};
</script>

<style lang="scss" scoped>
.answer-item {
    padding: 22px 23px;
    padding-bottom: 0;
    cursor: pointer;
    &:hover {
        background-color: #f7f9fb;
    }
}

.title {
    font-size: 16px;
    color: #333333;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.line {
    margin-top: 22px;
    height: 1px;
    width: 100%;
    background-color: #eeeeee;
}
</style>
